import request from '@/utils/request'

// 获取领队列表
export function getTeamleaderList(params) {
  if(params) {
    return request({
      url: `/work/teamleader/list?page=${params.pageNum}&rowsPerPage=${params.pageSize}`,
      method: 'get'
    })
  } else {
    return request({
      url: `/work/teamleader/list`,
      method: 'get'
    })
  }
  
}

// 新增领队
export function insert(data) {
  return request({
    url: '/work/teamleader/saveOrUpdate',
    method: 'post',
    data:data
  })
}

export function update(data) {
  return request({
    url: '/work/teamleader/saveOrUpdate',
    method: 'post',
    data:data
  })
}

// 删除领队
export function batchDelete(params) {
  return request({
    url: '/work/teamleader/delete-by-ids',
    method: 'get',
    params:params
  })
}
// 获取领队信息
export function getById(params) {
  return request({
    url: '/work/teamleader/' + params.id,
    method: 'get'
  })
}